<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/jsp/common/common.jsp"%>
<html>
	<head>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script>
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '查询',
				            icon:"<%=contextPath%>/images/query.gif",
				            handler:cmt
				        
				        },'-', 
				        {
				            text: '删除',
				            icon:"<%=contextPath%>/images/delete.gif",
				            handler:deleteIt,
				            hidden:<%=session.getAttribute("btn_delete_display") != null || "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>
				        }
			    	]
			    });
			});
		</script>
	</head>
	<body>
	<div id = "tbar" style="position:absolute;display:block left:0px; top:0px; width:100%; height:8%; z-index:1;"></div>
	<br>
	<div id="Layer" style="position:absolute;display:block left:0px; top:36px; width:100%; height:92%; z-index:1000; overflow:auto;">
		<form id="frmM"   name="frmM" method="POST" action="">
			<input type="hidden" name="searchBean.displayFlag" value="${searchBean.displayFlag}"/>
			<input type="hidden" name="conditionHtml" />
			<table width="100%" id="contab">
				<tr>
					<th width="120">
						日志操作时间：
					</th>
					<td>
						<input type="text" readonly="true" name="searchBean.con1" size="12" onclick="{img_con1.click()}" id="searchBean.con1" value="${searchBean.con1}"/>
						<img id="img_con1" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con1')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
						&nbsp;
						至
						&nbsp;
						<input type="text" readonly="true"  onclick="{img_con2.click()}" size="12" name="searchBean.con2" id="searchBean.con2" value="${searchBean.con2}"/>
						<img id="img_con2" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
					<th width="120">
						用户账号：
					</th>
					<td>
						<input type="text" name="searchBean.con3"  id="searchBean.con3" value="${searchBean.con3}"/>
					</td>
				</tr>

			</table>
			<hr>
			<table width="100%" id="listtab">
				<tr>
					<th   width="25">
						<input name="chkAll" type="checkbox" id="chkAll"
							onclick="javascript:checkAll(this.form, 'id');" value="checkbox">
					</th>
					<th   width="120">用户账号</th>
					<th   width="120">用户名称</th>
					<th   width="120">登陆时间</th>
					<th   >操作描述</th><!--
					<th   width="10%" nowrap>MAC</th>
					<th   width="10%" nowrap>IP地址</th>
					<th   width="10%" nowrap>机器名称</th>-->
				</tr>
				
				<c:forEach items="${list}" var="log" >
					<tr>
						<td width="25" >
							<input type="checkbox" name="id"  value="${log.id}"/>
						<br></td>
						<td   width="120"><c:out value="${log.userid}"/></td>
						<td   width="120"><c:out value="${log.username}"/></td>
						<td   width="120"><fmt:formatDate value="${log.logtime}" pattern="yyyy/MM/dd:HH:mm"/></td>
						<td   ><c:out value="${log.actiondesc}"/></td><!--
						<td   width="10%" nowrap><c:out value="${log.mac}"/></td>
						<td   width="10%" nowrap><c:out value="${log.ip}"/></td>
						<td   width="10%" nowrap><c:out value="${log.name}"/></td>-->
					</tr>
				</c:forEach>

				<c:if test="${list == null || fn:length(list) == 0 }">
					<tr>
						<td colspan="9" style="text-align: center">
							无相关记录
						</td>
					</tr>
				</c:if>
			</table>
			<hr>
			<table width="100%">
				<tr>
					<td>${pageDown}</td>
				</tr>
			</table>
		</form>
		</div>
	</body>
</html>
<script language="javascript">

			// 查询
			function cmt(){
				//document.frmM.elements["conditionHtml"].value = document.getElementById("sp").innerHTML; 
				document.frmM.action = "<%=contextPath%>/logList!getList.do";//&page=1&searchBean.conAdvance=" + getWhere();
				document.frmM.submit();
			}

			// 删除
			function deleteIt()
			{
				if(!isChecked("id")) {
		 			alert("请选择要删除的日志");
		 			return false;
		 		}
		    	if(confirm("确定要删除选中的日志吗？")) {
		        	document.frmM.action = "<%=contextPath%>/log!delete.do";
					document.frmM.submit();
		    	}
			}

		</script>